package omp.syst.jui;

import java.awt.*;
import java.awt.image.*;

import javax.swing.*;


public class DisplayPanel extends JPanel{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private BufferedImage newImage, tempImage;
	
	public DisplayPanel(){
		
	}
	
	public void paint( Graphics g ){
		
		if( tempImage != null )
			g.drawImage( tempImage, 250 - tempImage.getWidth()/2, 20, null );
		else if( newImage != null )
			g.drawImage( newImage, 250 - newImage.getWidth()/2, 20, null );
		else
			return;
	}
	
	public void loadNewImage( BufferedImage img ){

		this.newImage = img;
		repaint();
	}
	
	public BufferedImage getNewImage( ){
		
		return this.newImage;
	}
	
	public void changeImage( BufferedImage argImage ){
		
		this.tempImage = argImage;
	}
}